/*
 * =====================================================================================
 *
 *       Filename:  main.cc
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  08/20/21 15:10:33
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  XXXXXXX (), XXXX@jd.com
 *        Company:  JDAI
 *        Copyright:  Copyright 2021, XXXXXXX
 *
 * =====================================================================================
 */
#include <string>
#include <stdlib.h>
#include <string>
#include <memory>

#include "Log.h"
#include "Phone.h"
#include "ForeignHotel.h"
#include "ChinaHotel.h"
#include "PowerAdapter.h"

using std::string;
using std::shared_ptr;
using std::make_shared;
using std::cout;
using std::endl;

static const string TAG = "main";

int main(void) {
    Log::Init(NULL);
    //phone
    cout << endl;
    LogI("buy Phone\n");
    PhoneSPtr phone = make_shared < Phone > ();
    //PowerAdapter
    cout << endl;
    LogI("buy power adapter\n");
    PowerAdapterSPtr powerAdapter = make_shared < PowerAdapter > ();
    //American
    cout << endl;
    LogI("I'll go to American and book hotel\n");
    ForeignHotelSPtr foreignHotel = make_shared < ForeignHotel > ();
    foreignHotel->SetAdapter(powerAdapter);
    //
    LogI("I am going ForeignHotel and charging\n");
    foreignHotel->Charging();
    //
    LogI("I'll go to China and book hotel\n");
    ChinaHotelSPtr chinaHotel = make_shared < ChinaHotel > ();
    chinaHotel->SetAdapter(powerAdapter);
    //
    LogI("I am going ChinaHotel and chargine\n");
    chinaHotel->Charging();
    cout << endl;
    LogI("Charing end , I will go back");
    return 0;
}
